/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-4-8
 * Time: 下午7:20
 * To change this template use File | Settings | File Templates.
 */
//传入 lj.jyjg, lj.lx
//0、金融,1、采购 2、销售 3、保供
$.fn.ljcombobox = function (jyjg, lx) {
    var option = {
        url: $.webPath() + '/organ/ljwh/ljinfo?queryLj.jyjg=' + jyjg + "&queryLj.lx=" + lx,
        valueField: 'id',
        textField: 'mc',
        panelHeight: '200'
    }
    this.combobox($.createArg(option, arguments));
}
$.fn.ljcombobox1 = function () {
    var option = {
        url: $.webPath() + '/organ/ljwh/ljinfo',
        valueField: 'id',
        textField: 'mc',
        panelHeight: '200'
    }
    this.combobox($.createArg(option, arguments));
}
$.fn.xyljcombobox = function (jyjg, lx,sfkjxy,jybm) {
    var option = {
        url: $.webPath() + '/organ/ljwh/ljinfo?queryLj.jyjg=' + jyjg + "&queryLj.lx=" + lx + "&queryLj.sfkjxy=" + sfkjxy + "&queryLj.jybm=" + jybm,
        valueField: 'id',
        textField: 'mc',
        panelHeight: '200'
    }
    this.combobox($.createArg(option, arguments));
}

//传入 lj.jyjg
//4、库存零售
$.fn.ljkclscombobox = function (jyjg) {
    var option = {
        url: $.webPath() + '/organ/ljwh_kcls/ljwh_kcls_info?jyjgId=' + jyjg,
        valueField: 'id',
        textField: 'mc',
        panelHeight: '200'
    }
    this.combobox($.createArg(option, arguments));
}

$.fn.ljsxyCombobox = function (paramOptions) {
    paramOptions.lx = (typeof paramOptions.lx == "undefined") ? "3" : paramOptions.lx;
    paramOptions.jyjg = (typeof paramOptions.jyjg == "undefined") ? "" : paramOptions.jyjg;
    paramOptions.sxy = (typeof paramOptions.sxy == "undefined") ? "xy" : paramOptions.sxy;
    var options = {
        url: $.webPath() + '/organ/ljwh/sxy_list?queryLj.jyjg=' + paramOptions.jyjg + "&queryLj.lx=" + paramOptions.lx + "&queryLj.sxy=" + paramOptions.sxy,
        valueField: 'id',
        textField: 'jc',
        panelHeight: '200'
    };
    $.extend(options, paramOptions);
    $(this).combobox(options);
}


//查询销售路径详情
$.fn.ljDetail = function(ljId) {
    if(ljId){
        var options = {
            content: $('<div></div>'),
            onShow: function(){
                $(this).tooltip('arrow').css('left', 20);
                $(this).tooltip('tip').css('left', $(this).offset().left);
                $(this).tooltip('tip').css({
                    backgroundColor: '#666',
                    borderColor: '#666',
                    boxShadow: '1px 1px 3px #292929'
                });
            },
            onUpdate: function(cc){
                cc.panel({
                    width: 500,
                    height: 'auto',
                    border: false,
                    href: $.webPath() + '/organ/ljwh/ljwh_xs?ljId='+ljId
                });
            }
        }
        $(this).tooltip($.createArg(options,arguments));
    }
}
